package exo1;


public class Point {
	
	private int x;
	private int y;
	public Point() {
		super();
	}
	public Point(int x, int y) {
		super();
		this.x = x;
		this.y = y;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public Point additioner(Point point){
		Point p=new Point();
		p.x=(x+point.x);
		p.y=(y+point.y);
		return p;
	}
	public void imprimer(){
		System.out.println("("+x+","+y+")");
	}
	@Override
	public String toString() {
		return "Point[x=" + x + ", y=" + y + "]";
	}
	@Override
	public boolean equals(Object arg) {
		// TODO Auto-generated method stub
		if(!(arg instanceof Point))
			return false;
		Point p=(Point)arg;
		return (p.x==x&&p.y==y);
	}
	
	
}
